<script setup>

</script>

<template>
  <div class="shell">
    <div class="content">
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
    </div>
  </div>
</template>

<style scoped>
.shell {
  position: relative;
  width: 60vw;
  height: 40vw;
  max-width: 380px;
  max-height: 250px;
  margin: 0;
  color: #fff;
  perspective: 1000px;
  position: absolute;
  left: 35%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  width: 100%;
  height: 100%;
  transform-origin: center;
  transform-style: preserve-3d;
  transform: translateZ(-30vw) rotateY(0);
  animation: carousel 9s infinite cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.item {
  position: absolute;
  width: 60vw;
  height: 40vw;
  max-width: 380px;
  max-height: 250px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  background-size: cover;
  -webkit-box-reflect: below 5px -webkit-linear-gradient(transparent 50%, rgba(255, 255, 255, 0.3));
}

.item:nth-child(1) {
  background-image: url(@/assets/pictures/item1.jpg);
  transform: rotateY(0) translateZ(35vw);
}

.item:nth-child(2) {
  background-image: url(@/assets/pictures/item2.jpg);
  transform: rotateY(120deg) translateZ(35vw);
}

.item:nth-child(3) {
  background-image: url(@/assets/pictures/item3.jpg);
  transform: rotateY(240deg) translateZ(35vw);
}

@keyframes carousel {

  0%,
  17.5% {
    transform: translateZ(-17.5vw) rotateY(0);
  }

  27.5%,
  45% {
    transform: translateZ(-17.5vw) rotateY(-120deg);
  }

  55%,
  72.5% {
    transform: translateZ(-17.5vw) rotateY(-240deg);
  }

  82.5%,
  100% {
    transform: translateZ(-17.5vw) rotateY(-360deg);
  }
}
</style>